//
//  YWEquipmentTroubleRecord.h
//  maintain
//
//  Created by 郑想 on 15/11/11.
//  Copyright © 2015年 ewin. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "YWEquipmentMaintenanceRecord.h"
@class YWTroubleEquipmentTypeJson;
@class YWLocation;
@class YWTroubleContact;
@class YWTroubleMissionModel;
@class YWReportTroubleModel;
@class YWShortEquipmentType;

typedef NS_ENUM(NSInteger, YWMalfunctionRecordType) {
    /**修好的*/
    YWMalfunctionRecordTypeFixed = 0,
    YWMalfunctionRecordTypeNOFixed = 1,
};

typedef NS_ENUM(NSInteger, YWMalfunctionRecordReplacementStatus) {
    /**未更换*/
    YWRecordReplacementStatusNO = 0,
    YWRecordReplacementStatusYES = 1,
};

typedef NS_ENUM(NSInteger, YWMalfunctionRecordReasonId) {
    /**维修原因*/
    YWMalfunctionRecordReasonIdEnvironment = 0,
    YWMalfunctionRecordReasonIdNature = 1,
    YWMalfunctionRecordReasonIdManMade = 2,
    YWMalfunctionRecordReasonIdQuality = 3,
    YWMalfunctionRecordReasonIdConstruction = 4,
    YWMalfunctionRecordReasonIdLeaveBehind = 5,
    YWMalfunctionRecordReasonIdOther = 6,
};

@interface YWTroubleJson : NSObject
@property (nonatomic, assign) NSTimeInterval reportTime;
@property (nonatomic, copy) NSString* note;
/**微信报障人对象*/
@property (nonatomic, strong) YWTroubleContact *troubleContact;
/**报障图片*/
@property (nonatomic, strong) NSArray* pictures;
@property (nonatomic, strong) YWLocation* location;
@end

//配件
@interface YWTroubleRecordReplacements : NSObject
@property (nonatomic, copy) NSString* replacementName;
@end

@interface YWEquipmentTroubleRecord : YWEquipmentMaintenanceRecord
/**原因ID*/
@property (nonatomic, assign) YWMalfunctionRecordReasonId reasonId;
/**是否更换配件*/
@property (nonatomic, assign) NSInteger replacementStatus;
/**配件名称*/
@property (nonatomic, copy) NSString* replacementName;
/**配件数组*/
@property (nonatomic, copy) NSArray *replacements;
/**维修结果*/
@property (nonatomic, assign) YWMalfunctionRecordType recordType;
/**是否是报障产生的记录*/
@property (nonatomic, assign) BOOL report;
/**设备类型Id*/
@property (nonatomic, assign) NSInteger equipmentTypeId;
/**设备类型对象(id和name，用于解析)*/
@property (nonatomic, copy) YWShortEquipmentType *equipmentType;
/**报障姓名*/
@property (nonatomic, copy) NSString* reporterName;
/**报障人电话*/
@property (nonatomic, copy) NSString* reporterNumber;
/**故障描述*/
@property (nonatomic, copy) NSString* reportNote;
/**报障时间*/
@property (nonatomic, assign) NSTimeInterval reportTime;
/**二维码Id*/
@property (nonatomic, copy) NSString *qrcodeId;
/**人工费用*/
@property (nonatomic, strong) NSString* laborCosts;
/**材料费用*/
@property (nonatomic, strong) NSString* materialCosts;

@property (nonatomic, assign) NSInteger troubleId;
//---解析记录模块的维修任务记录用
//@property (nonatomic, strong) YWTroubleJson* trouble;
@property (nonatomic, strong) YWReportTroubleModel *trouble;
@property (nonatomic, assign) NSTimeInterval createTime;
@end


@interface YWEquipmentTroubleRecordJson : YWEquipmentMaintenanceRecordJson
/**完成时间*/
@property (nonatomic, assign) NSTimeInterval createTime;
/**任务ID*/
@property (nonatomic, assign) NSInteger troubleId;
/**原因ID*/
@property (nonatomic, assign) NSInteger reasonId;
/**是否更换配件*/
@property (nonatomic, assign) NSInteger replacementStatus;
/**配件名称*/
@property (nonatomic, copy) NSString* replacementName;
/**配件数组*/
@property (nonatomic, copy) NSArray *replacements;
/**维修结果*/
@property (nonatomic, assign) YWMalfunctionRecordType recordType;
/**报障时间*/
@property (nonatomic, assign) NSTimeInterval reportTime;
/**报障人*/
@property (nonatomic, strong) YWHandler* reporter;
/**故障描述*/
@property (nonatomic, strong) NSString* reportNote;
/**人工费用*/
@property (nonatomic, strong) NSString* laborCosts;
/**材料费用*/
@property (nonatomic, strong) NSString* materialCosts;
/**设备类型对象*/
@property (nonatomic, strong) YWTroubleEquipmentTypeJson* equipmentType;
/**二维码Id*/
@property (nonatomic, copy) NSString* qrcodeId;
/**报障内容*/
//@property (nonatomic, strong) YWTroubleJson* trouble;
/*报障对象*/
@property (nonatomic, strong) YWReportTroubleModel * trouble;
@property (nonatomic, strong) YWTroubleMissionModel * troubleMission;
@end
